﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style TargetType="{x:Type Button}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="White" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="ToolTip" Value="{Binding Command.Text, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border
                        x:Name="OuterBorder"
                        Background="{TemplateBinding Background}"
                        CornerRadius="5" 
                        BorderThickness="1">
                        <Grid>
                            <Border x:Name="Mask" CornerRadius="5" />
                            <ContentPresenter 
                                x:Name="contentSite" 
                                Grid.RowSpan="2" 
                                HorizontalAlignment="Center" 
                                VerticalAlignment="Center" 
                                Width="Auto"/>
                            <Grid>
                                <Grid.OpacityMask>
                                    <VisualBrush Visual="{Binding ElementName=Mask}"/>
                                </Grid.OpacityMask>
                                <Border 
                                    x:Name="InnerBorder"
                                    CornerRadius="5" 
                                    BorderThickness="1" 
                                    Margin="-1" 
                                    ClipToBounds="True">
                                </Border>
                            </Grid>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Mask" Property="Background" Value="#FFB8B8B8" />
                            <Setter TargetName="OuterBorder" Property="BorderBrush" Value="#FF5B5B5B" />
                            <Setter TargetName="InnerBorder" Property="BorderBrush" Value="#FF5B5B5B" />
                            <Setter TargetName="InnerBorder" Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect BlurRadius="7" Color="Black" Direction="0" ShadowDepth="0"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Mask" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Color="#FFD2E6FA" Offset="0" />
                                        <GradientStop Color="#FF98B4D2" Offset="1" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="OuterBorder" Property="BorderBrush" Value="Gray" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="contentSite" Property="Opacity" Value="0.4" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>